//
//  RootView.m
//  NavigationDemo
//
//  Created by 李林 on 13-3-31.
//  Copyright (c) 2013年 李林. All rights reserved.
//

#import "RootView.h"

@interface RootView ()

@end

@implementation RootView


- (void)viewDidLoad
{
    [super viewDidLoad];
	
}

- (void)loadView{
    UIView *baseView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen]applicationFrame]];
    baseView.backgroundColor = [UIColor purpleColor];//紫色
    self.view = baseView;
    [baseView release];
    
    //代码添加一个Button
    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [button setTitle:@"push" forState:UIControlStateNormal];
    [button setFrame:CGRectMake(90, 100, 140, 40)];
    [button addTarget:self
               action:@selector(pushVC)
     forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button];
//    [button release];
    
}

#pragma mark - Target Action

-(void)pushVC{
    SecoundView *secound =[[SecoundView alloc]init];
    [self.navigationController pushViewController:secound animated:YES];
    [secound release];
    
}


@end
